package com.sky.task;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class MyTask {
    private static final Logger log = LoggerFactory.getLogger(MyTask.class);

    /**
     * 定时任务 每隔五秒触发一次
     */
//    @Scheduled(cron = "0/5 * * * * ?")
    public void executeTask() {
        log.info("定时任务开启：{}", new Date());

    }
}
